<template>
  <div>
     <common
      :deviceserial="deviceserial"
      :title="title"
      :valiPage="valiPage"
      :device="device"
      :accessToken="accessToken"
      :addressCode="addressCode"
    ></common>
  </div>
</template>
<script>
import common from "./commonvideo.vue";
export default {
  name: "list1",
  components: {
    common
  },
  data() {
    return {
      title: "广利河北二路",
      valiPage: [],
      valiList: [],
      name: "",
      device: { waterLeavel: 4 },
      accessToken: "", 
      deviceserial: "", 
       addressCode:"",
    };
  },
  created() {
    var that = this;
      that.$http
        .post("device/indexFindByMenuUrl", {
          url: that.$route.fullPath
        })
        .then(res => {
          that.device = res.data;

          that.$http
            .post("deviceCamera/findByStationId", {
              stationId: that.device.stationId
            })
            .then(res => {
              console.log("vo", res);
              that.valiList = res.data;
              that.valiList.forEach(item => {
                item.endTime = `https://open.ys7.com/ezopen/h5/iframe_se?url=${item.videoAddress}&accessToken=${item.accessToken}`;
                that.accessToken = item.accessToken;
                that.deviceserial = item.cameraNumber;
              });
              that.valiPage = that.valiList;
            });
          console.log("res", res);
        });
  }
};
</script>